package com.winspread.app.map

import androidx.lifecycle.Observer
import com.winspread.active.extension.loge
import com.winspread.app.R
import com.winspread.app.databinding.ActivityMapTestBinding
import com.winspread.mvvm.base.vm.BaseActivity
import com.winspread.mvvm.util.click

class MapTestActivity : BaseActivity<MyViewModel,ActivityMapTestBinding>(R.layout.activity_map_test) {


    var  i = 0
    override fun initView() {
        val user = User("1--$i", "2--$i", 23)

        binding.but1.click {
            i++
            user.lastName = "${i}++++"
          viewModel.userLiveData.value =user

        }

    }

    override fun onOberver() {
        viewModel.userName.observe(this, Observer {
            binding.tv.text = it

        })


        viewModel.s.observe(this, Observer {
            "viewmodel--s  $it".loge()
        })

    }
}